<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			function add(num1, num2, callback) {
				let sum = num1 + num2
				callback(sum) //执行回调函数
			}

			function print(sum) {//回调函数
				console.log(sum)
			}
			add(1, 5, print)
		</script>
	</body>
</html>